[T4Scaffolding.Scaffolder(Description = "Scaffolds a whole use-case.")][CmdletBinding()]
param(        
    [parameter(Mandatory = $true)][string]$ModelType,
    [string]$Project,
	[string]$CodeLanguage,
	[string[]]$TemplateFolders,
	[switch]$Force = $false
)

$index = $Project.IndexOf(".")
if ($index -lt 1) { return }

$module = $Project.Substring(0,$index)

$frontendProject = $module+".Frontend"
$commonProject = $module+".Common"
$backendProject = $module+".Backend"

$contextType = "ModelContext"

Scaffold ZeroScaffolding.EFDbContext  $ModelType $contextType -BackendProject $backendProject -CommonProject $commonProject

Scaffold ZeroScaffolding.ListViewModel $ModelType -FrontendProject $frontendProject -CommonProject $commonProject -BackendProject $backendProject -Force:$Force
Scaffold ZeroScaffolding.ListView $ModelType -FrontendProject $frontendProject -CommonProject $commonProject -Force:$Force

Scaffold ZeroScaffolding.EditViewModel $ModelType -FrontendProject $frontendProject -CommonProject $commonProject -BackendProject $backendProject -Force:$Force
Scaffold ZeroScaffolding.EditView $ModelType -FrontendProject $frontendProject -CommonProject $commonProject -Force:$Force